package cn.itcast.web.controller.baiduMap;

import cn.itcast.domain.cargo.Export;
import cn.itcast.service.cargo.ExportService;
import cn.itcast.web.controller.BaseController;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/baidumap/map")
public class MapController extends BaseController {

    @Reference
    private ExportService exportService;
    

    @RequestMapping(value = "/lookMap",name = "查看地图路线")
    public String lookMap(String id){
        if (id!=null&&!id.equals("undefined")&&id!="") {
            Export export = exportService.findById(id);
            String start = export.getShipmentPort();
            String end = export.getDestinationPort();

            request.setAttribute("start",start);
            request.setAttribute("end",end);

            return "/cargo/baiduMap/lookMap";
        }

        return "/cargo/baiduMap/lookMap";
    }

    @RequestMapping(value = "/subway",name = "查看地铁路线")
    public String subway(String id){
        return "/cargo/baiduMap/subway";
    }

}
